package com.sleep.ruledemo.listener;

import com.sleep.ruledemo.domian.listener.WxListenerMessage;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author Guo Ao
 * @className com.sleep.ruledemo.listener.WxListener
 * @date 2025/3/27 15:31
 * @description TODO
 */
@Component
@Slf4j
public class WxListener {

     /**
       * @author Guo Ao
       * @date 2025/3/27 17:10
       * @description TODO <h3 style="color: red;">使用@EventListener注解监听监听的事件不可以带有泛型 否则会监听不到相应的事件<h3/>
       * @param
       * @return
       */
    @EventListener
    @Async
    public void wxListener(WxListenerMessage message) throws InterruptedException {
        Thread.sleep(1000L);
        log.info("theadName：{} 接受到的消息：{}", Thread.currentThread().getName(),message);
    }
}
